【软件填坑日记】服务器安装OrthoFinder 您所在的位置:网站首页 simpletest 1mb报错 【软件填坑日记】服务器安装OrthoFinder

【软件填坑日记】服务器安装OrthoFinder

2024-04-18 17:44| 来源: 网络整理| 查看: 265

OrthoFinder 鉴定直系同源基因,构建物种树的神器,今天在服务器安装了一次,踩了好多个坑,终于安装上了。

安装方法conda: conda install -c bioconda orthofindergithub: 作者在跟新的最新版本中说明linux下直接解压,然后将软件写入环境变量就可以用了。踩坑第一坑 numpy

刚开始涂省事,直接用conda装了一个,然后 orthofinder -h 测试了下发现了一个老问题:import numpy的时候出错了! 这个错误在我用python脚本的时候就见过,经过当时一顿找原因发现了在我调用numpy的时候,总会调用系统默认的(集群上python2被装在一个tools路径下。)也就是py2的numpy, 我先后conda下装python3,然后pip install numpy发现也没有卵用,他不会调用我装的py3的package,总是会默认的调用那个py2的numpy。目前对我来说是无解的。(后来我也尝试了在自己的账号下装python3 --prefix,然而也没有什么卵用,只要一调numpy,sitepackage就会指向服务器原来那个py2的numpy)。所以最后我放弃在conda下安装orthoFinder。

第二坑 RAxML

第二种就是去github下载OrthoFinder.tar.gz,然后解压文件结构如下:

├── bin │ ├── diamond │ ├── fastme │ └── mcl ├── config.json ├── ExampleData │ ├── Mycoplasma_agalactiae.faa │ ├── Mycoplasma_gallisepticum.faa │ ├── Mycoplasma_genitalium.faa │ └── Mycoplasma_hyopneumoniae.faa ├── License.md ├── orthofinder ├── OrthoFinder-manual.pdf ├── README.md ├── tools │ ├── convert_orthofinder_tree_ids.py │ ├── make_ultrametric.py │ └── primary_transcript.py └── version_2.3.12

可以看到相关的依赖diamond; fastme; mcl都已经搞定了,但是orthofinder并没有在bin下面,这就拉闸了,需要手动写一个alias. 于是我把依赖写到了环境变量,顺手给orthofinder写一个alias.

## 依赖写入环境变量 export PATH=/xxx/path/OrthoFinder/bin/$PATH ## orthofinder alias orthofinder='/xxx/path/orthofinder'

这样基本软件就搞定了。 基本用法:

orthofinder -f path/ -S diamond -M msa -T raxml -t 8 # 1. -f 存放你要比对的物种的蛋白序列路径 # 2. -S 比对方法,如果不想等很久的话就diamond吧,毕竟是软件的亮点之一。比对速度是blastp很多倍,结果也差不多。 # 3. -M msa 基因树推断方法 # 4. -T 建树方式,这里选择raxml # 5. -t 序列搜索线程数,考虑到提交到集群,所以直接用了8个线程

既然用了raxml方法,发现软件没装,所以

conda install -c bioconda raxml -y # 安装完后 第一次说在计算节点下跑完拉倒于是 ssh node17 orthofinder -f path/ -S diamond -M msa -T raxml -t 8

又报错了! 原因是raxml有问题!,我他 就纳闷了,明明装了,而且特地的查了下raxml发现

(base) [wangxiao@node100 04.Orthologous]$ raxmlHPC raxmlHPC raxmlHPC-PTHREADS raxmlHPC-PTHREADS-SSE3 raxmlHPC-AVX2 raxmlHPC-PTHREADS-AVX2 raxmlHPC-SSE3

也没问题。到底是怎么回事? 在github issue里发现了raxml错误, 大佬提出:

Hi Jorge Thanks for letting me know about this. The problem is in OrthoFinder's configuration file telling it how to run RAxML. I'll submit a fix for this. In the meantime, you can make a change to the configuration file on your machine to get it working. You'd need to edit the config.json file found in the same directory as the orthofinder.py script. The entry for RAxML should look like this: "raxml":{ "program_type": "tree", "cmd_line": "raxmlHPC-AVX -m PROTGAMMALG -p 12345 -s INPUT -n IDENTIFIER -w PATH > /dev/null", "ouput_filename": "PATH/RAxML_bestTree.IDENTIFIER" },Note that I've included "> /dev/null" in the command line. This prevents it printing loads of output to screen when inferring gene trees for all the orthogroups but you can remove this part if you need to debug anything and then the output will be printed to screen. The SimpleTest.fa file that you found is not actually the one used to test RAxML, the test file actually used does in fact have enough sequences in it and with RAxML configured correctly the test passes fine.

应该是配置文件中的问题,于是我返回去看了config.json果然:

"raxml":{ "program_type": "tree", "cmd_line": "raxmlHPC-AVX -m PROTGAMMALG -p 12345 -s INPUT -n IDENTIFI ER -w PATH > /dev/null", "ouput_filename": "PATH/RAxML_bestTree.IDENTIFIER"

中raxml调用raxmlHPC-AVX,在我conda安装版本的命令alias为 raxmlHPC-AVX2,原来是版本问题,所以就把这里改成了raxmlHPC-AVX2

"raxml":{ "program_type": "tree", "cmd_line": "raxmlHPC-AVX2 -m PROTGAMMALG -p 12345 -s INPUT -n IDENTIFI ER -w PATH > /dev/null", "ouput_filename": "PATH/RAxML_bestTree.IDENTIFIER"

再运行,果然work了。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有